package rudia.org.user.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.core.Local;
import org.springframework.stereotype.Service;

import rudia.org.core.RuMap;
import rudia.org.user.dao.UserDao;

@Service
public class LoginService {

	@Autowired
	private UserDao userDao;

	public RuMap loginUser(RuMap<String, Object> rumap) {
		
		String encrypasswd = this.encryption((String) rumap.get("passwd"),"ARIA","simplex");
		RuMap<String, Object> user = userDao.selectById(rumap);
		
		/*Login 처리*/
		if(user !=null && encrypasswd.equals(user.get("passwd"))){
			return user;
		}else{
			
			return null;
		}
		
	}

	private String encryption(String string, String aa, String bb) {
//	암호화 방법, 양단방향		simplex , duplex, 
		if(string!=null){
			// TODO Auto-generated method stub
			
		}else{
			string="";
		}
		return string;
	}

}